summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2017-08-30 11:41:31 +0200
committerMattes D <github@xoft.cz>2017-08-30 15:25:14 +0200
commitbc7ffc5448fc24a00661be7b6229d404e0b94114 (patch)
tree1239049b6ef3e0eee8f5fda26129d2bf704ededd
parentAdd cLuaStateParams::Read for high-level bindings usage. (diff)
downloadcuberite-LuaStateParamsRead.tar
cuberite-LuaStateParamsRead.tar.gz
cuberite-LuaStateParamsRead.tar.bz2
cuberite-LuaStateParamsRead.tar.lz
cuberite-LuaStateParamsRead.tar.xz
cuberite-LuaStateParamsRead.tar.zst
cuberite-LuaStateParamsRead.zip
-rw-r--r--src/Bindings/LuaStateParams.h1
-rw-r--r--src/Bindings/ManualBindings.cpp56
2 files changed, 55 insertions, 2 deletions
diff --git a/src/Bindings/LuaStateParams.h b/src/Bindings/LuaStateParams.h
index 0e8dc1b2d..8c7cbbfc2 100644
--- a/src/Bindings/LuaStateParams.h
+++ b/src/Bindings/LuaStateParams.h
@@ -9,6 +9,7 @@
#include "LuaState.h"
+#include "tolua++/include/tolua++.h"
diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp
index ee9cb61e9..afedbc052 100644
--- a/src/Bindings/ManualBindings.cpp
+++ b/src/Bindings/ManualBindings.cpp
@@ -3,9 +3,9 @@
#include "ManualBindings.h"
#undef TOLUA_TEMPLATE_BIND
+#include "LuaStateParams.h"
#include <sstream>
#include <iomanip>
-#include "tolua++/include/tolua++.h"
#include "polarssl/md5.h"
#include "polarssl/sha1.h"
#include "PluginLua.h"
@@ -3452,6 +3452,56 @@ static int tolua_cServer_RegisterForgeMod(lua_State * a_LuaState)
+static int tolua_cServer_TestApiSpeedOld(lua_State * a_LuaState)
+{
+ cLuaState L(a_LuaState);
+ if (
+ !L.CheckParamSelf("cServer") ||
+ !L.CheckParamString(2, 3) ||
+ !L.CheckParamNumber(4) ||
+ !L.CheckParamEnd(5)
+ )
+ {
+ return 0;
+ }
+
+ cServer * Server;
+ AString Name, Version;
+ UInt32 Protocol;
+ L.GetStackValues(1, Server, Name, Version, Protocol);
+
+ return 0;
+}
+
+
+
+
+
+static int tolua_cServer_TestApiSpeedNew(lua_State * a_LuaState)
+{
+ cLuaState L(a_LuaState);
+ cServer * Server;
+ AString Name, Version;
+ UInt32 Protocol;
+ auto self = cLuaStateParams::self(Server);
+ auto staticSelf = cLuaStateParams::staticSelf<cServer>();
+ switch (cLuaStateParams::Read(L,
+ std::tie(self, Name, Version, Protocol),
+ std::tie(staticSelf, Name, Version, Protocol)
+ ))
+ {
+ case 0:
+ {
+ // Do nothing
+ }
+ }
+ return 0;
+}
+
+
+
+
+
static int tolua_cScoreboard_GetTeamNames(lua_State * L)
{
cLuaState S(L);
@@ -4220,7 +4270,9 @@ void cManualBindings::Bind(lua_State * tolua_S)
tolua_endmodule(tolua_S);
tolua_beginmodule(tolua_S, "cServer");
- tolua_function(tolua_S, "RegisterForgeMod", tolua_cServer_RegisterForgeMod);
+ tolua_function(tolua_S, "RegisterForgeMod", tolua_cServer_RegisterForgeMod);
+ tolua_function(tolua_S, "TestApiSpeedOld", tolua_cServer_TestApiSpeedOld);
+ tolua_function(tolua_S, "TestApiSpeedNew", tolua_cServer_TestApiSpeedNew);
tolua_endmodule(tolua_S);
tolua_beginmodule(tolua_S, "cStringCompression");